package com.example.mapper;

//import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.pojo.entity.Activity;
import com.example.pojo.entity.Goods;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface GoodsMapper {


    @Insert("insert into goods(name,picture,price,state) values(#{name},#{picture},#{price},#{state})")
    void insert(Goods goods);

    @Update("update goods set name=#{name},picture=#{picture},price=#{price},state=#{state} where id=#{id}")
    void updateById(Goods goods);

    @Delete("delete from goods where id=#{id}")
    void removeById(Integer id);

    @Select("select * from goods")
    List<Goods> list();

    @Select("select * from goods where id=#{id}")
    Goods getById(Integer id);

    List<Goods> selectByPage(String name,Integer state);

    @Select("select * from goods where name=#{name}")
    Goods selectByName(String name);
}
